package com.sense.kukoo.common.wiget.dialog

import android.app.Activity
import android.app.Dialog
import android.os.Bundle
import android.widget.ImageView
import com.sense.kukoo.common.R
import com.sense.kukoo.lib_picture.config.GlideConfig
import com.sense.kukoo.lib_picture.loader.Monet

class LoadDialog constructor(context: Activity, attrs: Int = R.style.loading_dialog) :
    Dialog(
        context, attrs
    ), IDiaLog {
    private lateinit var loadingIv: ImageView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.common_loading_dialog)
        setCanceledOnTouchOutside(false)
        loadingIv = findViewById(R.id.loading_quan_img)
        Monet.get(context)
            .load<GlideConfig>(R.mipmap.common_sense_loading)
            .into(loadingIv)
    }

    override fun clear() {
        dismiss()

    }
}